package com.itheima.demo1;

import java.util.Random;

public class DemoRandom {
    public static void main(String[] args){
        //创建对象
        Random r = new Random();

        for (int i = 1;i <= 10;i++){
            //获取随机数
            int num = r.nextInt(10) + 1;
            System.out.println(num);
        }
    }
}
